/**
 * 
 */
package com.zhiteng.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.zhiteng.entity.CourseTable;

import tk.mybatis.mapper.common.Mapper;

/**  
* <p>Title: CourseTableMapper.java</p>  
* <p>Description: </p>  
* @author dragon  
* @date 2018年11月8日  
* @version 1.0  
*/
public interface CourseTableMapper extends Mapper<CourseTable>{
	
	@Select("SELECT DISTINCT grade_name FROM tb_course_table WHERE school_id=#{schoolId} AND grade_name IS NOT NULL")
	List<String> queryGradeBySchool(@Param("schoolId")String schoolId);
	
	@Select("SELECT DISTINCT class_name FROM tb_course_table WHERE school_id=#{schoolId} AND grade_name=#{gradeName} ORDER BY class_name")
	List<String> queryClassBySchoolAndGrade(@Param("schoolId")String SchoolName,@Param("gradeName")String gradeName);
	
	@Select("SELECT MAX(total_node) FROM tb_course_table WHERE school_id=#{schoolId}")
	Integer queryTotalNode(@Param("schoolId")String schoolId);
	
	@Select("SELECT MAX(total_day) FROM tb_course_table WHERE school_id=#{schoolId}")
	Integer queryTotalDay(@Param("schoolId")String schoolId);
	
	@Select("SELECT teacher_name FROM tb_course_table WHERE school_id=#{schoolId} AND TYPE=2 AND teacher_id IS NULL")
	List<String> queryUnmatchedTeacherNamesBySchoolId(@Param("schoolId")String schoolId);

}
